package com.example.mytips.demos;

import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.psi.PsiFile;

///help菜单>HelloWorld:弹出提示框
public class HelpMenuHelloWorld extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {
        ///当前工程
        Project project = e.getProject();

        ///上下文
        DataContext context = e.getDataContext();

        ///当前文件
        PsiFile psiFile = CommonDataKeys.PSI_FILE.getData(context);

        ///当前文件路径
        String classPath = psiFile.getVirtualFile().getPath();

        String title = "Hello World!";
        String msg = "这是一条自定义文本1";

        ///显示消息
        Messages.showMessageDialog(project,msg,title,Messages.getInformationIcon());
    }
}
